$.getUrlParam = function (name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
};
$.Pageable = function () {  
    //var e = $('#' + e_name);  
    //默认属性值  
    this.page = 2;  
    this.limit = 5;  
    this.sort = "releaseDate";  
    this.dir = "desc";  
    //属性的获取与设置方法  
  
    /*this.setPage = function (value) {  
        page = value;  
    };  
    //           
    this.setLimit = function (value) {  
        limit = value;  
    };  
    //  
    this.setSort = function (value) {  
        sort = value;  
    };  
    //  
    this.setDir = function (value) {  
        dir = value;  
    };
    return this;  */
};  
if($.getUrlParam("id")!=null && $.getUrlParam("id")>0){
	var id = $.getUrlParam("id");
	$.ajax({
		type:"POST",
		url:"subpage/newsDetail",
		dataType:"json",
		data:{id:id},
		success:function(result){
			
			$("#nav_phone").html(result.phone);
			$("#breadcrumb").html(result.breadcrumb);
			$("#business_nav").html(result.business_nav);
			$("#subpage_content").html(result.content);
			$("#address").html(result.address);
			$("#b_phone").html(result.phone);
			$("#email").html(result.email);
		}
	});
}else if($.getUrlParam("page")!=null && $.getUrlParam("page")>0){
	var pageable = new $.Pageable();
	pageable.page = $.getUrlParam("page");
	$.ajax({
		type:"POST",
		url:"subpage/newsList",
		dataType:"json",
		data:pageable,
		success:function(result){
			
			$("#nav_phone").html(result.phone);
			$("#breadcrumb").html(result.breadcrumb);
			$("#business_nav").html(result.business_nav);
			$("#subpage_content").html(result.content);
			$("#address").html(result.address);
			$("#b_phone").html(result.phone);
			$("#email").html(result.email);
		}
	});
}else{
	$.ajax({
		type:"POST",
		url:"subpage/newsList",
		dataType:"json",
		success:function(result){
			
			$("#nav_phone").html(result.phone);
			$("#breadcrumb").html(result.breadcrumb);
			$("#business_nav").html(result.business_nav);
			$("#subpage_content").html(result.content);
			$("#address").html(result.address);
			$("#b_phone").html(result.phone);
			$("#email").html(result.email);
		}
	});
}
